#!/bin/bash
useradd taiga
cd /home/taiga  
git clone https://github.com/taigaio/taiga-back.git taiga-back  
cd taiga-back/  
git checkout stable  

#sed -i -e '34s/^/#/ig' requirements.txt  
#sed -i -e '34a git+https://github.com/Xof/django-pglocks.git' requirements.txt  
/usr/local/python/bin/pip3 install -r requirements.txt  
chown -R taiga:taiga /home/taiga/  
#sed -i -e '1a #!/usr/local/python/bin/python3.5' -e '1d' manage.py

source /etc/profile
su taiga -c {"
cd /home/taiga/taiga-back
python3 manage.py migrate --noinput  
python3 manage.py loaddata initial_user  
python3 manage.py loaddata initial_project_templates  
#python3 manage.py loaddata initial_role  
python3 manage.py compilemessages  
python3 manage.py collectstatic --noinput
"}

